#!/usr/bin/make -f
#export DH_VERBOSE = 1

DEST_DIR="./debian/cilium/"

%:
	dh $@ --with systemd

override_dh_auto_build:
	make

override_dh_installinit:

	for svc in $(shell ls ./contrib/systemd/*.* ); do \
		cp -f "$$svc" "./debian/"; \
		service=$$(echo $$svc | sed -E -n 's/.*\/(.*?).(service|mount)/\1/p'); \
		dh_installinit --name=$${service}; \
	done

	mkdir -p "$(DEST_DIR)/etc/sysconfig/"
	cp "contrib/systemd/cilium" "$(DEST_DIR)/etc/sysconfig/cilium"
